home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19990725-20000114
/
000137_news@columbia.edu _Mon Oct 4 12:22:46 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id MAA29991
for <kermit.misc@watsun.cc.columbia.edu>; Mon, 4 Oct 1999 12:22:46 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id LAA04230
for kermit.misc@watsun.cc.columbia.edu; Mon, 4 Oct 1999 11:57:56 -0400 (EDT)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Subject: Re: carrier-watch. How do I set it off???
Date: 4 Oct 1999 15:57:55 GMT
Organization: Columbia University
Message-ID: <7taiq3$442$1@newsmaster.cc.columbia.edu>
To: kermit.misc@columbia.edu
In article <37F8B572.F0134ECF@americasm01.nt.com>,
Yoner, Clinton (EXCHANGE:WDLN2:2Y64) <cyoner@americasm01.nt.com> wrote:
: I am running a script which starts kermit as follows:
:
: kermit -C "log session $2, c, exit" -l /dev/$1 -b 9600
:
: With kermt 7.0 beta (i am running Linux 6.0) it barks about the
: "carrier" and I have to set it "OFF"
: Yes I am just talking to a device ( not a modem) via TTYS1.
: So am looking for a command-line option to add to the above kermit call
:
We don't have command-line options that correspond to every command and
setting. That's what the -C "commandlist" escape clause is for:
kermit -C "set car of, set lin /dev/$1, set sp 9600, l s $2, c, ex"
(Minimal abbreviations are used to keep the line length down.) The trick is
to put everything in the command list, because when you mix a command list
with command-line options, the order of execution might not be what you
expect (see "Using C-Kermit", pp.461-462, for details).
C-Kermit 7.0 supports a new execution method, called the "kerbang" script,
in which Kermit scripts can be run as if they were shell scripts (or Perl
scripts, etc), with arguments passed on the command line. Here is a sample,
which illustrates how to add robustness (arguments are checked for, errors
are handled, etc):
#!/usr/local/bin/wermit +
if not def \%1 exit 1 \%0: Device name required
if not def \%2 exit 1 \%0: Logfile name required
log session \%2
if fail exit 1 Can't open logfile \%2
set modem type none
set carrier-watch off
set line /dev/\%1
if fail exit 1 Can't open /dev/\%1
set speed 9600
connect
exit
Save it as "makeaconnection" and then you can:
$ makeaconnection ttyS0 foo.log
For details, plus lots of examples of kerbang scripts, see:
http://www.columbia.edu/kermit/ckscripts.html
- Frank